package gewu.suleju.sevice.imp;

import gewu.suleju.dao.iml.IHouseDetailDao;
import gewu.suleju.model.pojo.HouseInfor;
import gewu.suleju.sevice.ISearchLatitudeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class SearchLatitudeServiceImp implements ISearchLatitudeService {
    @Autowired
    public IHouseDetailDao iHouseDetailDao;

    @Autowired
    private RedisTemplate redisTemplate;

    @Override
    public void findLatitudeById(Integer id) {
        List<String> list = new ArrayList<>();
        HouseInfor houseInfor = iHouseDetailDao.findHouseInforById(id);
        list.add(houseInfor.getLatitude());
        list.add(houseInfor.getLongitude());

        redisTemplate.opsForValue().set("Latitude", list);

        //return list;
    }
}
